package com.cyou.qb.face.service.mock;

import org.springframework.stereotype.Component;

import com.cyou.qb.face.entity.ActivityInfo;
import com.cyou.qb.face.entity.Face173AccessLog;
import com.cyou.qb.face.entity.trans.ActReturn;
import com.cyou.qb.face.exception.QbGetDataException;
import com.cyou.qb.face.service.QbOperateService;
import com.cyou.qb.face.service.impl.BaseFaceServiceimpl;
/**
 * QBOperate接口的mock实现
 * @author wangwenlong
 *
 */
@Component("QbOperateMock")
public class QbOperateServiceMock extends BaseFaceServiceimpl implements QbOperateService{

	@Override
	public ActReturn applyGb(String passport, String password, int gbvalue,ActivityInfo info) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		ActReturn acr = new ActReturn();
		acr.setAccId("123123");
		acr.setFlag("1");
		return acr;
	}

	@Override
	public int appendGb(String passport, String password, int activeid,
			int gbvalue,String memo) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		return 1;
	}

	@Override
	public int getUserGb(String passport) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		return 500;
	}

	@Override
	public boolean plusGb(String passport,int activeid,int gbvalue,String memo) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		return true;
	}


	@Override
	public MinusGbResult minusGb(String passport, int gbvalue, String memo, int channelId) {
		Face173AccessLog accessLog = getAccessLog();
		accessLog.setCallService(this.getClass().getName());
		accessLog.setCallServiceParam("http://i1.17173.itc.cn/2011/newgame/newgamepic");
		return MinusGbResult.SUCCESS;
	}
}
